<template>

    <!-- 添加或修改对话框 -->
    <lam-dialog :title="title" :visible.sync="open" width="680px" append-to-body @close="cancel" >
      <el-form :ref="formRef" :model="form" :rules="rules" label-width="100px" :disabled="formDisabled">
        <el-row>
          <el-col :span="12">
            <el-form-item label="订单号" prop="orderNumber">
              <span>{{form.orderNumber}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="操作备注" prop="operRemark">
              <el-input v-model="form.operRemark" type="textarea" :autosize="{ minRows: 2}" placeholder="" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-popconfirm v-if="form.opType=='closeOrder'" confirm-button-text='确定关闭' cancel-button-text='取消' icon="el-icon-info" icon-color="red"
          title="强制关闭订单后不能恢复，确定要关闭该订单？" @confirm="submitForm">
          <el-button slot="reference" type="primary" :loading="loading">确 定</el-button>
        </el-popconfirm>
        <el-button v-else type="primary" @click="submitForm" :loading="loading">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </lam-dialog>

</template>

<script>
import { EditMixin } from '@/components/mixins/EditMixin';

export default {
  name: "AddOrderLog",
  mixins:[EditMixin],
  data() {
    return {
      url: {
        base: '/mall/order/addLog'
      },
      // 表单校验
      rules: {
        operRemark: [{ required: true, message: "操作备注不能为空", trigger: "blur" }],
      },
    };
  },
  created() {
  },
  methods: {
    // 表单重置
    reset() {
      this.form = {
        orderNumber: null,
        operRemark: null,
        opType: 'addLog'
      };
    },

    /** 提交按钮 */
    submitForm(){
      this.saveForm(this.url.base);
    }

  }
};
</script>
<style scoped>
  .testssssssssss{
    color: red;
  }
</style>
